package com.ailanyin.admin.config;

import com.ailanyin.common.model.IdWorker;
import com.ailanyin.common.utils.FileUtil;
import com.ailanyin.common.utils.LinuxUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * 系统配置
 *
 * @author ailanyin
 * @version 1.0
 * @since 2021/10/18 0018 下午 13:21
 */
@Configuration
public class SysConfig {

    @Value("${spring.application.name}")
    private String applicationName;

    @Bean
    public IdWorker idWorker() {
        return new IdWorker(1,1);
    }

    @Bean
    public void createJarService() {
        LinuxUtil.createJarService(applicationName, FileUtil.getJarPath());
    }
}
